<template>
	<view>
		<view class="header">
			<p  @click="fanhui">
				< </p>
		</view>
		<view class="list">
			<view class="login">
				注册
			</view>
		
			<view class="pwd">
					<input type="text" class="input" v-model="obj.username" name="" id="" placeholder="请输入用户名">
				<input type="password" class="input" v-model="obj.password" id="" placeholder="请输入密码">
				<input type="password" class="input" v-model="obj.repassword" placeholder="请输入确认密码">
			</view>
			<view class="button">
				<u-button type="#5ccc84" id="demo1" @click="zc">注册</u-button>
			</view>
			<view class="item">
				<p @click="tiao">去登陆</p>
				<p>忘记密码？</p>
			</view>
			<view class="icon">
				<u-icon name="weixin-circle-fill" color="green" size="40"></u-icon>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {zcList} from "../../api/user.js"
	export default {
		data() {
			return {
				obj:{
					username:"",
					password:"",
					repassword:""
				},
				user:uni.getStorageSync("user")
			}
		},
		methods: {
			//返回上一级
			fanhui(){
				uni.navigateBack({
					delta:1
				})
			},
			tiao(){
				uni.navigateTo({
					url:"/pages/login/login"
				})
			},
			async zc(){
			
				let res=await zcList(this.obj)
				console.log(res);
				uni.showToast({
				    title: res.data,
				    duration: 2000
				});
				if(this.user.phone=="undefined"){
					uni.navigateTo({
						url:"/pages/bind-phone/bind-phone"
					})
				}else{
					uni.navigateTo({
						url:"/pages/login/login"
					})
				}
				
			}

		},
	}
</script>

<style scoped lang="scss">
	* {
		box-sizing: border-box;
	}

	.icon {
		width: 600rpx;
		height: 50rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: auto;

	}

	.item {
		width: 600rpx;
		height: 100rpx;
		display: flex;
		align-items: center;
		margin: auto;
		justify-content: space-between;
		padding-left: 30rpx;
		padding-right: 30rpx;
		margin-top: 20rpx;

		p:nth-child(1) {
			color: green;
			font-size: 30rpx
		}

		p:nth-child(2) {
			font-size: 30rpx;
			color: gray;

		}
	}

	.button {
		width: 600rpx;
		height: 100rpx;
		margin: auto;
		background-color: yellow;
		margin-top: 20rpx;
		background-color: #5ccc84;
		color: white;

		#demo1 {
			width: 600rpx;
			height: 100rpx;
			font-size: 30rpx
		}
	}

	.list {
		width: 750rpx;
		height: 1000rpx;
		background-color: #fff;
		border-top-left-radius: 32px;
		border-top-right-radius: 32px;
		margin-top: -20rpx;

		.pwd {
			width: 600rpx;
			margin: auto;

			.input {
				height: 100rpx;
				width: 600rpx;
				font-size: 30rpx;
				padding-left: 50rpx;
				margin-top: 30rpx;
				background-color: #F5F5F5;
			}
		}

		.login {
			width: 750rpx;
			height: 80rpx;
			display: flex;
			align-items: center;
			padding-left: 40rpx;
			font-size: 22px;
			color: #35404b;
		}
	}

	.header {
		width: 750rpx;
		height: 250rpx;
		background-image: linear-gradient(to right, #3DFCB1, #6ADAEA);

		p {
			padding-left: 34px;
			padding-top: 12px;
			font-size: 33px;
			color: white;
		}
	}
</style>
